<?php

class FB{

	function show_news_feed($newsfeed){
		$h = "";
			$h .= "<table width=\"500\">";
			$h .= "<tr></tr>";
	  
	  
			foreach ($frd as $frdArray) {
			  
			 
			  foreach ($frdArray as $item) {
				 $h .= "<tr>";  
				  $h .= "<td><img src='https://graph.facebook.com/".$item['id']."/picture'</td>";
				  $h .="<td>
				  		<a href='http://web.eureka.lk/crushdemo/index.php?
						ac=add&user=".$me['id']."&subac=".$item['id']."&name=".$item['name']."'>".$item['name']."</a>
						</td>";
 
				$h .= "</tr>";
				
				
				//$str = $me['id'] ."," .$item['id']. ",".$item['name'];
			  }
			  
			 
		  }
		$h .= "</table>";
	  echo $h;
	
	}
	
	
	public function post_news($id,$access_token){
	
			
	
	
			
			/*if($_SERVER["REQUEST_METHOD"] == "POST")
			{
				$status = $_POST['status'];
				//$sql=mysql_query("select facebook_id,facebook_access_token from users where username='$user_session'");
				//$row=mysql_fetch_array($sql);
				//$facebook_id=$row['facebook_id'];
				//$facebook_access_token=$row['facebook_access_token'];
				//Facebook Wall Update
				$params = array('access_token'=>'257478380945147|2.AQDqiiFD3fKGmyB_.3600.1312131600.1-100002750642576|Bn1eiJYK8rFpNI3_WHQvbrwbaV4&expires=5137', 'message'=>$status);
				$url = "https://graph.facebook.com/$id/feed";
				$ch = curl_init();
				curl_setopt_array($ch, array(
				CURLOPT_URL => $url,
				CURLOPT_POSTFIELDS => $params,
				CURLOPT_RETURNTRANSFER => true,
				CURLOPT_SSL_VERIFYPEER => false,
				CURLOPT_VERBOSE => true
				));
				$result = curl_exec($ch);
				// End
			}*/

		//HTML
		?>
			<form method="post" action="">
			<textarea name="status"></textarea>
			<input type="submit" value=" Update "/>
			</form>
	    <?php
	
	
	}
}
?>